package day11;

import java.util.HashSet;
import java.util.Scanner;

public class demo1 {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n= in.nextInt(),m= in.nextInt(),a= in.nextInt(),b= in.nextInt();
        HashSet<Integer>set=new HashSet<>();
        int f=0;

        for (; n>0&&m>0;n-=2,m-- ) {
            int n1=n;
            int m1=m;
            f+=a;
            int f1=f;
            while (n1>=2&&m1>=1){
                n1-=2;
                m1--;
f1+=a;
            }


        }


    }
}
